List index out of range error when adding a new dictionary key with iterating index numbers on said